<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <button @click="show = !show">切换</button>

        <!-- 但也不是说无条件复用 -->
        <!-- <div v-if="show" class="box1">我是box1</div>
        <div v-else class="box2">我是box2</div> -->
<!-- 
        <div v-if="show" class="box1">我是box1</div>
        <p v-else class="box2">我是p2</p> -->
    </div>

    <script src="./vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data() {
                return {
                    show: true
                }
            },
        })
    </script>
</body>
</html>